﻿using KAs.Application.Contract.Dto;
using KAs.Application.Contract.Dto.Interface;
using KAs.SqlSugar.Entity;

namespace KAs.Application.Contract.Svc;

public interface ICommonCurdAppService<TPrimaryKeyType, T, TCreateDto, TUpdateDto, TDto>
    where T : Entity<TPrimaryKeyType>, new()
    where TCreateDto : IEntityDto<TPrimaryKeyType>, new()
    where TUpdateDto : IEntityDto<TPrimaryKeyType>, new()
    where TDto : IEntityDto<TPrimaryKeyType>, new()
{
    public Task<TPrimaryKeyType> CreateAsync(TCreateDto createDto);

    public Task<bool> UpdateAsync(TUpdateDto updateDto);

    public Task<bool> DeleteAsync(TPrimaryKeyType id);

    public Task<TDto> GetAsync(TPrimaryKeyType id);

    public Task<PageReturnDto<TDto>> GetPageListAsync(PageReqDto pageReqDto);
}
